import json

from ronglian_sms_sdk import SmsSDK
from django.conf import settings

def send_message(tid, mobile, datas):
    ronglianyun = settings.RONGLIANYUN
    sdk = SmsSDK(ronglianyun.get('accId'),ronglianyun.get('accToken'),ronglianyun.get('appId'))
    # tid = 1
    # mobile = '19137729317'
    # datas = ('1206', '1')
    resp = sdk.sendMessage(tid, mobile, datas)
    response=json.loads(resp)
    print(resp)
    return response.get("statusCode") == '000000'
